package com.shiwaixiangcun.monitor.repository;

import com.rabbit.spring.data.repository.GenericJpaRepository;
import com.shiwaixiangcun.monitor.domain.WorkOrder;
import com.shiwaixiangcun.monitor.domain.WorkOrderServiceRecord;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by Administrator on 2017/11/23.
 */
public interface WorkOrderServiceRecordRepository extends GenericJpaRepository<WorkOrderServiceRecord, Long> {

    @Query(value = "from WorkOrderServiceRecord r where r.workOrder = :workOrder")
    List<WorkOrderServiceRecord> getServiceList(@Param("workOrder") WorkOrder workOrder);

}
